package top.continew.admin.system.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.continew.admin.system.mapper.CourseCardUrlMapper;
import top.continew.admin.system.model.entity.CourseCardUrlDO;
import top.continew.admin.system.service.CourseCardUrlService;

import java.util.List;

@Service
public class CourseCardUrlServiceImpl implements CourseCardUrlService {

    @Autowired
    private CourseCardUrlMapper courseCardUrlMapper;

    @Override
    public List<CourseCardUrlDO> getCourseCardImageList(String title) {
        return courseCardUrlMapper.selectList(new LambdaQueryWrapper<CourseCardUrlDO>()
                .like(StrUtil.isNotEmpty(title), CourseCardUrlDO::getTitle, title));
    }
}
